package com.wzdigit.wms.wms.service.core;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.wzdigit.wms.basic.domain.basic.Sku;
import com.wzdigit.wms.basic.mapper.core.basic.SkuMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * 货品核心服务类
 * @author yangdongjie
 * @UserDataPermissionService.java
 * @2021年1月18日下午4:02:50
 */
@Service
public class SkuCodeService {

	@Autowired
    private SkuMapper skuMapper;
	
	/**
	 * 主键查询
	 * @param skuId
	 * @return
	 */
	public Sku getSkuById(Integer skuId) {
		Sku sku = skuMapper.selectById(skuId);
		return sku;
    }
	
	/**
	 * 物料编码查询
	 * @param skuCode
	 * @return
	 */
	public Sku getSkuByCode(String skuCode) {
		QueryWrapper<Sku> queryWrapper = new QueryWrapper<>();
		queryWrapper.eq("SKU_CODE", skuCode);
		Sku sku = skuMapper.selectOne(queryWrapper);
		return sku;
    }
}
